<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/08/10 0010
 * Time: 10:54:19
 */
namespace app\admin\Controller;
use app\common\controller\Curt;
use think\Db;
class Bindbank extends Curt{
    public function getall()
    {
        $keyword=input('get.keyword');
        $where['a.status']=1;
        if($keyword){
            $where['b.user_realname']=['like','%'.$keyword.'%'];//模糊查询or可以一个条件中写多个字段以‘|’分开
        }
        $bindbank=Db::name('Bindbank')->alias('a')->join('ec_user b','a.user_id=b.id')
            ->where($where)->order('a.id desc')->field('a.*,b.user_realname')->paginate();
        $page = $bindbank->render();
        $bindbanks=$bindbank->toArray();
        $this->assign(
            ['bindbank'=>$bindbanks['data']],
            ['page'=>$page]
        );
    }

}